<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>系统</title>
<%@include file="/WEB-INF/jsp/include/easyui_1_5_3.jsp"%>

<script type="text/javascript">
	//请求地址
	var url;
	//提示消息
	var mesTitle;

	//页面加载后执行
	$(function(){
    });
	
	//审核用信息
 	function examineSysUnitInfo(){
	 	var row = $('#datagrid').datagrid('getSelected');
	 	if (row){
	 		var unit_id = row.unit_id;
		 	$('#dlg_delete').dialog('open').dialog('setTitle','审核');
		 	$('#fmdelete').form('load',row);
		 	url = path+"/sysUnitInfo/examine?unit_id="+unit_id;
		 	mesTitle = '审核成功';
	 	}else{
	 		$.messager.alert('提示', '请选择要审核的记录！', 'error');
	 	}
	}
 	
	//提交删除内容
	function saveSysUnitInfo_del(){
	 	$('#fmdelete').form('submit',{
		 	url: url,
		 	onSubmit: function(){
		 		return $(this).form('validate');
		 	},
			success: function(result){
				/* console.info(result); */
				var result = eval('('+result+')');
				if (result.success){
				 	$('#dlg_delete').dialog('close'); 
				 	$('#datagrid').datagrid('reload'); 
				} else {
					 mesTitle = '新增失败';
				}
				$.messager.show({ 
					 title: mesTitle,
					 msg: result.msg
				});
			}
	 	});
	}

	//快速查询
 	function searchSysUnitInfoQ(){
	 	$("#datagrid").datagrid("load", {
            "full_name": $('#search_username').val()
        });
	}
	
	//查询
 	function searchSysUnitInfo(){
		$('#dlgsearch').dialog('open').dialog('setTitle','查询');
		$('#fmsearch').form('clear');
		url = path+"/user/searchUser";
		mesTitle = '查询成功';
	}
	
	//刷新
	function reload(){
		$('#datagrid').datagrid('reload'); 
	}
</script>

</head>
<body class="easyui-layout" fit="true">
	<div region="center" border="false" style="overflow: hidden;">
		<!-- 信息列表 title="管理" -->
		<table id="datagrid" class="easyui-datagrid" 
		    fit="true"
			url="${path}/sysUnitInfo/datagrid" 
			toolbar="#toolbar" 
			pagination="true"
			fitColumns="false" 
			singleSelect="false" 
			rownumbers="true"
			striped="true"
			border="false" 
			nowrap="false">
			<thead>
				<tr>
					<th field="unit_id" width="100">单位ID</th>
					<th field="num" width="100">排序</th>
					<th field="short_name" width="100">药店简称</th>
					<th field="full_name" width="100">药店全称</th>
					<th field="start_date" width="100">启用日期</th>
					<th field="end_date" width="100">停用日期</th>
					<th field="licence_key" width="100">注册码</th>
					<th field="unified_social_credit_code" width="100">统一社会信用代码</th>
					<th field="contact_person" width="100">联系人</th>
					<th field="contact_phone" width="100">联系电话</th>
					<th field="contact_address" width="100">联系地址</th>
					<th field="account_name" width="100">户名</th>
					<th field="bank_name" width="100">开户行</th>
					<th field="bank_no" width="100">银行账号</th>
					<th field="regist_address" width="100">注册地址</th>
					<th field="phone" width="100">电话</th>
					<th field="artificial_name" width="100">法人</th>
					<th field="handle" width="100">操作人</th>
					<th field="handle_date" width="100">操作日期</th>
					<th field="examine" width="100">审核人</th>
					<th field="examine_date" width="100">审核日期</th>
					<th field="tips" width="100">备注</th>
					<th field="higher_unit_id" width="100">上级单位ID</th>
					<th field="higher_unit_ids" width="100">所有上级单位的ID英文逗号分隔</th>

				</tr>
			</thead>
		</table>

		<!-- 按钮 -->
		<div id="toolbar" style="padding:3px">
			<a href="javascript:void(0);" class="easyui-linkbutton"
				iconCls="icon-reload" plain="true" onclick="reload();">刷新</a>
			<a href="javascript:void(0);" class="easyui-linkbutton"
				iconCls="icon-edit" plain="true" onclick="examineSysUnitInfo();">审核</a>
			<span>药店名称:</span>
			<input name="search_username" id="search_username" value="" size=10 /> 
  			<a href="javascript:searchSysUnitInfoQ()" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a> 
			<a href="javascript:void(0);" class="easyui-linkbutton"
				iconCls="icon-jright" plain="true" onclick="searchSysUnitInfo();">更多查询</a>
		</div>

		<!-- 删除对话框 -->
		<div id="dlg_delete" class="easyui-dialog"
			style="width:300px;height:200px;padding:30px 20px" closed="true"
			buttons="#dlg-del-buttons">
			<div class="ftitle">请谨慎操作</div>
			<form id="fmdelete" method="post" novalidate>
					<label>确定审核吗？</label>
			</form>
		</div>
		
		<!-- 删除对话框按钮 -->
		<div id="dlg-del-buttons">
			<a href="javascript:void(0)" class="easyui-linkbutton c6"
				iconCls="icon-ok" onclick="saveSysUnitInfo_del()" style="width:90px">审核</a> 
			<a href="javascript:void(0)" class="easyui-linkbutton"
				iconCls="icon-cancel" onclick="javascript:$('#dlg_delete').dialog('close')"
				style="width:90px">取消</a>
		</div>
		
		<!-- 查询对话框 -->
		<div id="dlgsearch" class="easyui-dialog"
			style="width:400px;height:380px;padding:30px 20px" closed="true"
			buttons="#dlg_query-buttons">
			<form id="fmsearch" method="post" novalidate>
				<label>权限:</label>  
                    <span id="span1" style="display: inline-block;"></span>  
                </div>
			</form>
		</div>
		
		<!-- 查询对话框按钮 -->
		<div id="dlg_query-buttons">
			<a href="javascript:void(0)" class="easyui-linkbutton c6"
				iconCls="icon-ok" onclick="searchSysUnitInfo()" style="width:90px">查询</a> 
				<a href="javascript:void(0)" class="easyui-linkbutton"
				iconCls="icon-cancel" onclick="javascript:$('#dlgsearch').dialog('close')"
				style="width:90px">取消</a>
		</div>
		
	</div>
</body>
</html>
